<div class="row m-n">
    <div class="crumbs-bar">
        <div yb-crumbs></div>
    </div>
    <div tabset type="tab">
        <div tab heading="合同及协议管理" active="activeFlag[0]" ng-click="changeTab(0)">
            <div class="row wrapper-y-sm">
                <div class="operate-bar col-xs-4 font-0">
                    <button class="btn btn-operate m-r-sm" ng-click="addDataAuto()" translate>自动新增</button>
                    <button class="btn btn-operate m-r-sm" ng-click="addData()" translate>手动新增</button>
                </div>
                <div class="search-bar wrapper-none col-xs-8">
                    <div class="btn-group m-l-xs pull-right">
                        <button type="button" class="btn btn-default base-color" ng-click="search()" translate translate-attr-title="刷新">
                            <i class="yb-icon ico-refresh"></i>
                        </button>
                        <button type="button" class="btn btn-default base-color" translate translate-attr-title="配置表格列"
                                ng-click="switchToolbar('ColConfig');">
                            <i class="yb-icon ico-set"></i>
                        </button>
                        <div class="btn btn-default base-color">
                            <div translate translate-attr-title="导出">
                                <i class="yb-icon ico-export-o"></i>
                            </div>
                            <ul class="more-tool">
                                <li yb-download download-url="exportParam.sectionUrl"
                                    download-param="exportParam.sectionParam" download-key="ids">
                                    <i class="yb-icon ico-export-o"></i> 导出
                                </li>
                                <li yb-download download-url="exportParam.allUrl" download-param="condition" download-duration="3" is-ajax="true">
                                    <i class="yb-icon ico-export-o"></i><span translate>导出全部</span> 
                                </li>
                            </ul>
                        </div>
                    </div>
                    <button class="btn-advance pull-right m-l-xs" ng-click="switchToolbar('AdvanceSearch')" translate-attr-title="高级搜索" translate="高级搜索more"></button>
                    <div class="input-group pull-right clearfix">
                        <input type="text" class="form-control txt-search" translate translate-attr-placeholder="合同号" ng-model="condition.billNo">
                        <span class="input-group-addon cursor-pointer" ng-click="search(1)" translate>搜索</span>
                    </div>
                </div>
                <div yb-advance-search show-toolbar="toolbarConfig.showAdvanceSearch" search-data="search(1)" reset-data="reset()">
                    <div class="advance-search m-t-sm">
                        <div class="form-group clearfix">
                            <label class="control-label"><span translate>合同号</span> ：</label>
                            <input type="text" ng-model="condition.billNo" class="form-control">
                        </div>
                        <div class="form-group clearfix">
                            <label class="control-label"><span translate>客户名称</span> ：</label>
                            <input type="text" ng-model="condition.purchareOrgName" class="form-control">
                        </div>
                        <div class="form-group clearfix">
                            <label class="control-label"><span translate>付款方式</span> ：</label>
                            <input type="text" ng-model="condition.payType" class="form-control">
                        </div>
                        <div class="form-group clearfix m-b-none">
                            <label class="control-label">制单时间：</label>
                            <input type="text" class="form-control date-picker" ng-model="condition.createDateStart"
                                   datepicker-popup="{{'yyyy-MM-dd'}}"
                                   ng-click="showCreateDateStart = !showCreateDateStart"
                                   ng-change="checkDate(condition, 'createDateStart', 'createDateEnd')"
                                   is-open="showCreateDateStart" close-text="关闭" modal-size="small" readonly>
                        </div>
                        <div class="form-group clearfix m-b-none">
                            <label class="control-label"></label>
                            <label class="control-label wave-line">~</label>
                        </div>
                        <div class="form-group clearfix">
                            <label class="control-label"></label>
                            <input type="text" class="form-control date-picker" ng-model="condition.createDateEnd"
                                   datepicker-popup="{{'yyyy-MM-dd'}}"
                                   ng-click="showCreateEndDate = !showCreateEndDate"
                                   ng-change="checkDate(condition, 'createDateStart', 'createDateEnd')"
                                   is-open="showCreateEndDate" close-text="关闭" modal-size="small" readonly>
                        </div>
                    </div>
                </div>
            </div>
            <div yb-col-config show-toolbar="toolbarConfig.showColConfig" ng-model="tableConfig" col-fixed="false" has-check-col="true"></div>
            <div class="main-area">
                <div yb-table-fixed class="table-fixed-wrap fix-left" ele-count="4" scroll-area="right" style="top:13px">
                    <div class="th-fixed">
                        <table class="table-fixed border-none" width="{{tableConfig.fixedWidth}}">
                            <thead>
                                <tr>
                                    <th width="40" class="text-center border-l-none th-check">
                                        <div yb-check-box yb-checked="markInfo.allChecked" yb-click="selectAll(dataList,'','getBillIds')">
                                        </div>
                                    </th>
                                    <th ng-repeat="itemCol in tableConfig.tableCol track by $index"
                                        width="{{itemCol.width}}" ng-click="toSort(tableConfig.tableCol, $index)"
                                        ng-show="!!itemCol.isShow && !!itemCol.isFixed">
                                        <div yb-thead-operate ng-model="itemCol" target-width="tableConfig.fixedWidth"
                                            fixed-width="tbStyle.scrollLeft"></div>
                                    </th>
                                </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="th-scroll-x" ng-style="tbStyle.scrollLeft">
                        <table class="table-fixed border-none" width="{{tableConfig.scrollWidth}}">
                            <thead>
                                <tr>
                                    <th ng-repeat="itemCol in tableConfig.tableCol track by $index"
                                        width="{{itemCol.width}}" ng-click="toSort(tableConfig.tableCol, $index)"
                                        ng-show="!!itemCol.isShow && !itemCol.isFixed">
                                        <div yb-thead-operate ng-model="itemCol" target-width="tableConfig.scrollWidth">
                                        </div>
                                    </th>
                                </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="td-scroll-y" ng-show="dataList.length > 0" ng-style="tbStyle.scrollLeftWidth">
                        <table class="table-fixed border-none">
                            <tbody>
                                <tr ng-repeat="item in dataList track by $index"
                                    ng-class="{'row-selected': $index === markInfo.cueRow}"
                                    ng-click="selectRow($index)">
                                    <td width="40" class="text-center border-l-none">
                                        <div yb-check-box yb-checked="item.isChecked" yb-click="selectSingle(item, dataList,'','getBillIds')"></div>
                                    </td>
                                    <td class="spill-dots" ng-repeat="itemCol in tableConfig.tableCol track by $index"
                                        width="{{itemCol.width}}" ng-if="!!itemCol.isShow && !!itemCol.isFixed"
                                        title="{{item[itemCol.dataField]}}">

                                        <div class="font-0" ng-if="itemCol.type === 'operate'">
                                            <button class="btn btn-operate m-r-xs" ng-click="printData(item)">打印</button>
                                            <button class="btn btn-operate m-r-xs" ng-click="editData(item)">编辑</button>
                                            <button class="btn btn-operate m-r-xs"
                                                ng-click="deleteData(item)"
                                                ng-disabled="item.isSale==1">删除</button>
                                        </div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="td-scroll" ng-show="dataList.length > 0" ng-style="tbStyle.scrollLeft">
                        <table class="table-fixed border-none" width="{{tableConfig.scrollWidth}}">
                            <tbody>
                                <tr ng-repeat="item in dataList track by $index"
                                    ng-class="{'row-selected': $index === markInfo.cueRow}"
                                    ng-click="selectRow($index)">
                                    <td class="spill-dots" ng-repeat="itemCol in tableConfig.tableCol track by $index"
                                        width="{{itemCol.width}}" ng-show="!!itemCol.isShow && !itemCol.isFixed"
                                        title="{{item[itemCol.dataField]}}">
                                        <span ng-if="!itemCol.clickFn" >{{item[itemCol.dataField]}}</span>
                                        <a class="btn-operate m-r-xs" ng-click="tdClick(item, itemCol.clickFn)" ng-if="!!itemCol.clickFn" >
                                            {{item[itemCol.dataField]}}
                                        </a>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="no-data w-full text-center p-t" ng-show="dataList.length === 0" translate>暂时没有数据</div>
                </div>
            </div>
            <div class="bottom-area page-bar wrapper-y-sm clearfix">
                <div yb-page-info ng-model="pageInfo" yb-refresh="search()"></div>
            </div>
        </div>
        <div tab heading="{{tabFlag.name}}" active="activeFlag[1]" ng-if="activeFlag[1]">
            <div class="clearfix" ng-show="stepList.curStep == 0">
                <div class="row wrapper-y-sm">
                    <div class="search-bar wrapper-none col-xs-12">
                        <div class="btn-group m-l-xs pull-right">
                            <button type="button" class="btn btn-default base-color" ng-click="searchBills()" title="刷新">
                                <i class="yb-icon ico-refresh"></i>
                            </button>
                        </div>
                        <button class="btn-advance pull-right m-l-xs" ng-click="switchToolbar('AdvanceSearchAdd')">
                            高级搜索
                        </button>
                        <div class="input-group pull-right clearfix">
                            <input type="text" class="form-control txt-search" placeholder="采购单号" ng-model="conditionBill.billNo">
                            <span class="input-group-addon cursor-pointer" ng-click="searchBills(1)">搜索</span>
                        </div>
                    </div>
                </div>
                <div yb-advance-search show-toolbar="toolbarConfig.showAdvanceSearchAdd" search-data="searchBills(1)" reset-data="reset('conditionBill')">
                    <div class="advance-search m-t-sm">
                        <div class="form-group clearfix">
                            <label class="control-label"><span>采购单号</span>：</label>
                            <input type="text" class="form-control" ng-model="conditionBill.billNo">
                        </div>
                        <div class="form-group clearfix">
                            <label class="control-label"><span>客户名称</span>：</label>
                            <input type="text" class="form-control" ng-model="conditionBill.purchaseOrgName">
                        </div>
                    </div>
                </div>
                <div class="main-area">
                    <div yb-table-fixed class="table-fixed-wrap fix-left" ele-count="4" scroll-area="right">
                        <div class="th-fixed">
                            <table class="table-fixed border-none" width="{{tableConfigBill.fixedWidth}}">
                                <thead>
                                    <tr>
                                        <th width="40" class="text-center th-check border-l-none">
                                            <div yb-check-box yb-checked="markInfo.allCheckedBill"
                                                yb-click="selectAll(orderDataList, 'Bill', 'collectBillData')"></div>
                                        </th>
                                        <th ng-repeat="itemCol in tableConfigBill.tableCol track by $index"
                                            width="{{itemCol.width}}"
                                            ng-show="!!itemCol.isShow && !!itemCol.isFixed">
                                            <div yb-thead-operate ng-model="itemCol"
                                                target-width="tableConfigBill.fixedWidth"
                                                fixed-width="tbStyle.billFixedWidth"></div>
                                        </th>
                                    </tr>
                                </thead>
                            </table>
                        </div>
                        <div class="th-scroll-x" ng-style="tbStyle.billFixedWidth">
                            <table class="table-fixed border-none" width="{{tableConfigBill.scrollWidth}}">
                                <thead>
                                    <tr>
                                        <th ng-repeat="itemCol in tableConfigBill.tableCol track by $index"
                                            width="{{itemCol.width}}"
                                            ng-show="!!itemCol.isShow && !itemCol.isFixed">
                                            <div yb-thead-operate ng-model="itemCol"
                                                target-width="tableConfigBill.scrollWidth"></div>
                                        </th>
                                    </tr>
                                </thead>
                            </table>
                        </div>
                        <div class="td-scroll-y" ng-show="orderDataList.length > 0">
                            <table class="table-fixed border-none" width="{{tableConfigBill.fixedWidth}}">
                                <tbody>
                                    <tr ng-repeat="item in orderDataList track by $index">
                                        <td width="40" class="text-center border-l-none">
                                            <div yb-check-box yb-checked="item.isChecked"
                                                yb-click="selectSingle(item, orderDataList, 'Bill', 'collectBillData')"></div>
                                        </td>
                                        <td class="spill-dots"
                                            ng-repeat="itemCol in tableConfigBill.tableCol track by $index"
                                            width="{{itemCol.width}}" ng-show="!!itemCol.isShow && !!itemCol.isFixed"
                                            title="{{item[itemCol.dataField]}}">
                                            <span>{{item[itemCol.dataField]}}</span>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                        <div class="td-scroll" ng-show="orderDataList.length > 0" ng-style="tbStyle.billFixedWidth">
                            <table class="table-fixed border-none" width="{{tableConfigBill.scrollWidth}}">
                                <tbody>
                                    <tr ng-repeat="item in orderDataList track by $index">
                                        <td class="spill-dots"
                                            ng-repeat="itemCol in tableConfigBill.tableCol track by $index"
                                            width="{{itemCol.width}}" ng-show="!!itemCol.isShow && !itemCol.isFixed"
                                            title="{{item[itemCol.dataField]}}">
                                            <span>{{item[itemCol.dataField]}}</span>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                        <div class="no-data w-full text-center p-t" ng-show="orderDataList.length === 0">暂时没有数据</div>
                    </div>
                </div>
                <div class="bottom-area page-bar text-center wrapper-y-sm clearfix">
                    <button type="button" class="btn btn-primary" ng-disabled="selectedList.length==0" ng-click="nextStep()">下一步</button>
                    <div yb-page-info ng-model="orderPageInfo" yb-refresh="searchBills()"></div>
                </div>
            </div>
            <div class="clearfix" ng-show="stepList.curStep == 1">
                <form name="formRef" class="m-t-sm form-horizontal form-up-tb clearfix">
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 control-label max-w-100"><span>合同号</span>：</label>
                        <label class="col-xs-8 control-label p-l-n text-left spill-dots">
                            {{detailInfo.billNo || '-'}}
                        </label>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 control-label max-w-100"><span>接收单位</span>：</label>
                        <label class="col-xs-8 control-label p-l-n text-left spill-dots">
                            {{detailInfo.supplierOrgName || '-'}}
                        </label>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm" ng-if="tabFlag.type != 2">
                        <label class="col-xs-4 control-label max-w-100"><i>*</i><span>客户名称</span>：</label>
                        <div class="col-xs-8 wrapper-none">
                            <input type="text" name="purOrgName" class="form-control light-bg"
                                ng-model="detailInfo.purchareOrgName" ng-click="selectDealer()" required yb-focus
                                readonly placeholder="请选择">
                            <div class="msg-block"
                                ng-if="formRef.purOrgName.$dirty || (formRef.purOrgName.$invalid && submitted)">
                                <div class="error-msg"
                                    ng-if="formRef.purOrgName.$error.required && !formRef.purOrgName.focused">
                                    <div class="msg-triangle"></div>
                                    必填项，请填写
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm" ng-if="tabFlag.type == 2">
                        <label class="col-xs-4 control-label max-w-100"><span>客户名称</span>：</label>
                        <label class="col-xs-8 control-label p-l-n text-left spill-dots">
                            {{detailInfo.purchareOrgName || '-'}}
                        </label>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 control-label max-w-100"><span>采购申请单号</span>：</label>
                        <label class="col-xs-8 control-label p-l-n text-left spill-dots" title="{{detailInfo.purchaseNos || '-'}}">
                            {{detailInfo.purchaseNos || '-'}}
                        </label>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 control-label max-w-100"><span translate>调度员</span>：</label>
                        <div class="col-xs-8 wrapper-none">
                            <input type="text" name="dispatcherName" class="form-control light-bg"
                                ng-model="detailInfo.dispatcherName" ng-click="selectDispatch()" readonly yb-focus placeholder="请选择" ng-required="false">
    
                            <div class="msg-block"
                                ng-if="formRef.dispatcherName.$dirty || (formRef.dispatcherName.$invalid && submitted)">
                                <div class="error-msg"
                                    ng-if="formRef.dispatcherName.$error.required && !formRef.dispatcherName.focused"
                                    translate>
                                    <div class="msg-triangle"></div>
                                    必填项，请填写
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100"><span>制单时间</span>：</label>
                        <div class="col-xs-8 wrapper-none spill-dots">
                            {{(detailInfo.createDate|YbDate:"yyyy-MM-dd HH:mm:ss") || '-'}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 control-label max-w-100"><span>制单人</span>：</label>
                        <label class="col-xs-8 control-label p-l-n text-left spill-dots">
                            {{detailInfo.createName || '-'}}
                        </label>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 control-label max-w-100"><span translate>发运方式</span>：</label>
                        <div class="col-xs-8 wrapper-none">
                            <div select-send-type first-level-model="detailInfo.shippingMethodId" parent-type-name="detailInfo.shippingMethod"
                                second-level-model="detailInfo.sendTypeChildId" child-type-name="detailInfo.sendTypeChildName" is-require="false"></div>
                            <div class="msg-block"
                                ng-if="formRef.sendType.$dirty || (formRef.sendType.$invalid && submitted)">
                                <div class="error-msg"
                                    ng-if="formRef.sendType.$error.required && !formRef.sendType.focused">
                                    <div class="msg-triangle"></div>
                                    <span translate>必填项，请填写</span>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 control-label max-w-100"><span translate>付款方式</span>：</label>
                        <div class="col-xs-8 wrapper-none">
                            <div name="fklx" dealer-dictionary-selector ng-model="detailInfo.payType" sel-key="Payment_method" ng-required="false">
                                <input type="text" class="form-control light-bg" ng-model="detailInfo.payType" placeholder="请选择" readonly yb-focus>
                                <div class="msg-block" ng-if="formRef.fklx.$dirty || (formRef.fklx.$invalid && submitted)">
                                    <div class="error-msg" ng-if="formRef.fklx.$error.required && !formRef.fklx.focused">
                                        <div class="msg-triangle"></div>
                                        <span>必填项，请填写</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 control-label max-w-100"><span translate>付款条件</span>：</label>
                        <div class="col-xs-8 wrapper-none">
                            <div name="fktj" dealer-dictionary-selector ng-model="detailInfo.payCondition" sel-key="Payment_terms" ng-required="false">
                                <input type="text" class="form-control light-bg" ng-model="detailInfo.payCondition" placeholder="请选择" readonly yb-focus>
                                <div class="msg-block" ng-if="formRef.fktj.$dirty || (formRef.fktj.$invalid && submitted)">
                                    <div class="error-msg" ng-if="formRef.fktj.$error.required && !formRef.fktj.focused">
                                        <div class="msg-triangle"></div>
                                        <span>必填项，请填写</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 control-label max-w-100"><span translate>运费付费方式</span>：</label>
                        <div class="col-xs-8 wrapper-none">
                            <div name="yffffs" dealer-dictionary-selector ng-model="detailInfo.deliveryPayMethod" sel-key="Freight_paymentmeth" ng-required="false">
                                <input type="text" class="form-control light-bg" ng-model="detailInfo.deliveryPayMethod" placeholder="请选择" readonly yb-focus>
                                <div class="msg-block" ng-if="formRef.yffffs.$dirty || (formRef.yffffs.$invalid && submitted)">
                                    <div class="error-msg" ng-if="formRef.yffffs.$error.required && !formRef.yffffs.focused">
                                        <div class="msg-triangle"></div>
                                        <span>必填项，请填写</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 control-label max-w-100"><span>备注</span>：</label>
                        <div class="col-xs-8 wrapper-none">
                            <input type="text" class="form-control" ng-model="detailInfo.remark" maxlength="200">
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm" ng-if="isJCH">
                        <label class="col-xs-4 control-label max-w-100"><i>*</i>付款时间：</label>
                        <div class="col-xs-8 wrapper-none">
                            <input type="text" name="payDate" class="form-control date-picker cursor-pointer"
                                   ng-model="detailInfo.payDate"
                                   datepicker-popup="{{'yyyy-MM-dd HH:mm'}}" ng-click="showDatepicker = !showDatepicker"
                                   is-open="showDatepicker" close-text="关闭" readonly required>
                            <div class="msg-block"
                                 ng-show="formRef.payDate.$dirty || (formRef.payDate.$invalid && submitted)">
                                <div class="error-msg"
                                     ng-if="formRef.payDate.$error.required && !formRef.payDate.focused">
                                    <div class="msg-triangle"></div>
                                    必填项，请填写
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
                <div class="row wrapper-y-xs" ng-if="tabFlag.type==0">
                    <div class="col-xs-12 operate-bar font-0">
                        <button class="btn btn-operate m-r-sm" ng-click="selMateriel($event)">选择零件</button>
                        <button class="btn btn-operate m-r-sm" ng-click="importMateriel()">导入零件</button>
                    </div>
                </div>

                <div materiel-selector show-toolbar="toolbarConfig.showMateriel" selected-list="detailInfo.materialsList" dealer-id="detailInfo.purchaseOrgId" is-purchase="true"></div>

                <div class="main-area d-b-60" ng-style="{'top':tabFlag.type==0?(!!isJCH?'254px':'222px'):(!!isJCH?'222px':'180px')}">
                    <div yb-table-fixed class="table-fixed-wrap">
                        <div class="th-scroll-x">
                            <table class="table-fixed border-none" width="{{tableConfigMaterial.scrollWidth}}">
                                <thead>
                                    <tr>
                                        <th width="60" class="text-center">
                                            操作
                                        </th>
                                        <th ng-repeat="itemCol in tableConfigMaterial.tableCol track by $index"
                                            width="{{itemCol.width}}">
                                            <div yb-thead-operate ng-model="itemCol"></div>
                                        </th>
                                    </tr>
                                </thead>
                            </table>
                        </div>
                        <div class="td-scroll" ng-show="detailInfo.materialsList.length > 0">
                            <table class="table-fixed border-none" width="{{tableConfigMaterial.scrollWidth}}">
                                <tbody>
                                    <tr ng-repeat="item in detailInfo.materialsList track by $index">
                                        <td width="60">
                                            <button type="button" class="btn btn-operate" ng-click="delMateriel($index)">删除</button>
                                        </td>
                                        <td ng-repeat="itemCol in tableConfigMaterial.tableCol track by $index"
                                            width="{{itemCol.width}}" title="{{item[itemCol.dataField]}}">
                                            <div class="spill-dots" ng-if="!itemCol.needInput">
                                                {{item[itemCol.dataField]}}
                                            </div>

                                            <div ng-if="itemCol.needInput">
                                                <div ng-if="itemCol.inputType === 'qty'" class="td-edit pos-r">
                                                    <input type="text" class="form-control" ng-model="item[itemCol.dataField]"
                                                        yb-number-input max="9999999.99" disable-decimal="false" decimal-places="2"
                                                        ng-disabled="!!detailInfo.purchaseNos"
                                                        ng-change="checkRequired(item,'qty')"
                                                        ng-focus="showErrTip(item,'qty')" ng-blur="hideErrTip(item,'qty')"
                                                        ng-class="{'error':item.qtyErr||item.qtyShowErr}">
                                                    <div class="pos-a tool-tips" ng-if="!!item.qtyShowErr">
                                                        <i class="triangle"></i>
                                                        <div class="msg">数量不能为空和0</div>
                                                    </div>
                                                </div>
                                            </div>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                        <div class="no-data w-full text-center p-t" ng-show="detailInfo.materialsList.length === 0">暂时没有数据</div>
                    </div>
                </div>
                <div class="bottom-area btn-bar text-center border-t clearfix">
                    <button type="button" class="btn btn-default m-r-sm" ng-click="prevStep()" ng-if="tabFlag.type==2">上一步</button>
                    <button type="button" class="btn btn-primary m-r-sm" ng-click="saveData(formRef.$valid)">提交</button>
                    <button type="button" class="btn btn-default" ng-click="changeTab(0)">取消</button>
                </div>
            </div>
        </div>
        <div tab heading="详情" active="activeFlag[2]" ng-if="activeFlag[2]">
            <div class="m-t-sm form-up-tb clearfix">
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100"><span>合同号</span>：</label>
                    <label class="col-xs-8 wrapper-none spill-dots">
                        {{detailInfo.billNo || '-'}}
                    </label>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100"><span>接收单位</span>：</label>
                    <label class="col-xs-8 wrapper-none spill-dots">
                        {{detailInfo.supplierOrgName || '-'}}
                    </label>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100"><span>客户名称</span>：</label>
                    <label class="col-xs-8 wrapper-none spill-dots">
                        {{detailInfo.purchareOrgName || '-'}}
                    </label>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100"><span>采购申请单号</span>：</label>
                    <label class="col-xs-8 wrapper-none spill-dots" title="{{detailInfo.purchaseNos || '-'}}">
                        {{detailInfo.purchaseNos || '-'}}
                    </label>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100"><span>调度员</span>：</label>
                    <label class="col-xs-8 wrapper-none spill-dots">
                        {{detailInfo.dispatcherName || '-'}}
                    </label>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100"><span>制单时间</span>：</label>
                    <div class="col-xs-8 wrapper-none spill-dots">
                        {{(detailInfo.createDate|YbDate:"yyyy-MM-dd HH:mm:ss") || '-'}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100"><span>制单人</span>：</label>
                    <label class="col-xs-8 wrapper-none spill-dots">
                        {{detailInfo.createName || '-'}}
                    </label>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100"><span>发运方式</span>：</label>
                    <label class="col-xs-8 wrapper-none spill-dots">
                        {{(detailInfo.shippingMethod||'') + '-' + (detailInfo.sendTypeChildName||'')}}
                    </label>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100"><span>付款方式</span>：</label>
                    <label class="col-xs-8 wrapper-none spill-dots">
                        {{detailInfo.payType || '-'}}
                    </label>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100"><span>付款条件</span>：</label>
                    <label class="col-xs-8 wrapper-none spill-dots">
                        {{detailInfo.payCondition || '-'}}
                    </label>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100"><span>运费付费方式</span>：</label>
                    <label class="col-xs-8 wrapper-none spill-dots">
                        {{detailInfo.deliveryPayMethod || '-'}}
                    </label>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100"><span>备注</span>：</label>
                    <label class="col-xs-8 wrapper-none spill-dots">
                        {{detailInfo.remark || '-'}}
                    </label>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">付款时间：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{(detailInfo.payDate|YbDate:'yyyy-MM-dd HH:mm:ss') || '-'}}">
                        {{(detailInfo.payDate|YbDate:"yyyy-MM-dd HH:mm:ss") || '-'}}
                    </div>
                </div>
            </div>
            <div class="main-area d-b-60" ng-style="{'top':!isJCH?'150px':'170px'}">
                <div yb-table-fixed class="table-fixed-wrap">
                    <div class="th-scroll-x">
                        <table class="table-fixed border-none" width="{{tableConfigMaterial.scrollWidth}}">
                            <thead>
                                <tr>
                                    <th ng-repeat="itemCol in tableConfigMaterial.tableCol track by $index"
                                        width="{{itemCol.width}}">
                                        <div yb-thead-operate ng-model="itemCol"></div>
                                    </th>
                                </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="td-scroll" ng-show="detailInfo.materialsList.length > 0">
                        <table class="table-fixed border-none" width="{{tableConfigMaterial.scrollWidth}}">
                            <tbody>
                                <tr ng-repeat="item in detailInfo.materialsList track by $index">
                                    <td ng-repeat="itemCol in tableConfigMaterial.tableCol track by $index"
                                        width="{{itemCol.width}}" title="{{item[itemCol.dataField]}}">
                                        <div class="spill-dots">
                                            {{item[itemCol.dataField]}}
                                        </div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="no-data w-full text-center p-t" ng-show="detailInfo.materialsList.length === 0">暂时没有数据</div>
                </div>
            </div>
            <div class="bottom-area btn-bar text-center border-t clearfix">
                <button type="button" class="btn btn-default" ng-click="changeTab(0)">返回</button>
            </div>
        </div>
    </div>
</div>